﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Text;
using Pahan.McuFusion.Common;

namespace Pahan.McuFusion.Atmel.Avr
{
    public class AvrMcuInfo : DeviceInfo
    {
        internal AvrMcuInfo(String model, IList<MemoryClassInfo> memory)
        {
            Assert.NotNullOrEmpty(model, "model");
            Assert.NotNullOrEmpty(memory, "memory");
            this.model = model;
            this.memory = new ReadOnlyCollection<MemoryClassInfo>(memory);
        }
        
        #region Overrides of DeviceInfo

        public override String Vendor
        {
            get
            {
                return "Atmel";
            }
        }

        public override String Model
        {
            get
            {
                return model;
            }
        }

        public override IList<MemoryClassInfo> Memory
        {
            get { return memory; }
        }

        #endregion

        #region Private Members

        private readonly String model;

        private readonly IList<MemoryClassInfo> memory;

        #endregion

        #region Timing

        [Browsable(false)]
        public int FlashDelay
        {
            get; 
            internal set;
        }

        /// <summary>
        /// The delay required after the Write EEPROM instruction.
        /// </summary>
        [Browsable(false)]
        public int EepromDelay
        {
            get;
            internal set;
        }

        /// <summary>
        /// The delay required after the Chip Erase instruction.
        /// </summary>
        [Browsable(false)]
        public int EraseDelay
        {
            get;
            internal set;
        }

        #endregion
    }
}
